package resp

import (
	"github.com/gin-gonic/gin"
	"net/http"
)

func QueryErrorResp(c *gin.Context, msg string) {
	c.JSON(http.StatusOK, gin.H{
		"code":    -1,
		"message": msg,
	})
}

func ServerErrorResp(c *gin.Context, code int, msg string) {
	c.JSON(http.StatusOK, gin.H{
		"code":    code,
		"message": msg,
	})
}

func SuccessResp(c *gin.Context, data interface{}) {
	c.JSON(http.StatusOK, gin.H{
		"code":    0,
		"message": "success",
		"data":    data,
	})
}
